<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="vue.js"></script>
</head>
<body>
    <div id="f">
        <p>{{msg}}</p>
        <span v-for="yihang in yihangcount">{{s}}</span>
        <br><br>
        <button @click.once="showone" >点我新增一行</button>
        <button @click="show">{{dd}}</button>
        <br>
        <button v-for="item in itemcount">{{t}}</button>
        

    </div>


    <script>
        var v = new Vue({
            el:"#f",

            data:{
                msg:"haha",
                yihangcount:0,
                itemcount:0,
                dd:"点我增加按钮",
                s:"",
                t:"",
            },
            methods:{
                showone(){
                    this.yihangcount+=1;
                    this.s="新增的一行";
                },
                show(){
                    
                    this.itemcount +=1;
                    this.t="新增的按钮";
                }
            }
        })
    </script>
</body>
</html>